package view.events;
import flash.events.Event;
import flash.geom.Point;

enum E_MouseInteractionType
{
	MOUSE_DOWN;
	MOUSE_UP;
	MOUSE_MOVE;
	MOUSE_WHEEL;
}

enum E_TargetType
{
	RENDER_OBJECT;
	SCENE;
	PHYSIC_POINT;
	SOMETHING_ELSE;
}

/**
 * @author Damien Mabin
 */
class LevelEditorViewMouseEvent extends Event
{
	public static var EVENT 	: String = "LevelEditorViewMouseEvent";
	
	public var m_Type 			: E_MouseInteractionType;
	public var m_TargetType 	: E_TargetType;
	public var m_Target			: Dynamic;
	public var m_MouseMovement 	: Point;
	public var m_DeltaWheel		: Float;
	// the cordonate of the mouse position are the coordonate inside the Scene !! NOT global coordonate !
	public var m_MousePosition	: Point;
	
	public function new(_Type : E_MouseInteractionType, _TargetType : E_TargetType, _Position:Point) 
	{
		super(EVENT, true);
		m_Type = _Type;
		m_TargetType = _TargetType;
		m_MouseMovement = new Point();
		m_MousePosition = _Position;
		m_DeltaWheel = 0;
	}

	override public function clone():Event
    {
		var res : LevelEditorViewMouseEvent = new LevelEditorViewMouseEvent(m_Type, m_TargetType, m_MousePosition);
		res.m_Target 			= this.m_Target;
		res.m_MouseMovement.x 	= this.m_MouseMovement.x;
		res.m_MouseMovement.y 	= this.m_MouseMovement.y;
		res.m_DeltaWheel		= m_DeltaWheel;
        return res;
    }

    override public function toString():String
    {
        return EVENT + "(" + m_Type + ")";
    }
}